package pers.cz.controller;

import pers.cz.pub.RespBean;
import pers.cz.service.impl.UserDetailServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @program: PostGirl-panent
 * @description: UserController
 * @author: Cheng Zhi
 * @create: 2021-04-20 22:14
 **/
@RestController
@RequestMapping(path = "/api/User")
public class UserController {

    @Autowired
    UserDetailServiceImpl userService;

    @RequestMapping(path = "/getUserDtl")
    public RespBean getUserDtlByUserId(HttpServletRequest request) {

        int userId = Integer.valueOf(request.getAttribute("userId").toString());
        userService.selectUserDtlByUserId(userId);

        return RespBean.ok("查询成功");
    }

}
